import { useState, useEffect } from "react";

export default function useDogImages() {
  const [dogImages, setDogImages] = useState<string[]>([]);

  useEffect(() => {
    async function fetchDogs() {
      const res = await fetch(
        'https://dog.ceo/api/breed/labrador/images/random/6'
      );
      const { message } = await res.json();
      setDogImages(message);
    }

    fetchDogs();
  }, [])

  return dogImages;
}